<%--
  Created by IntelliJ IDEA.
  User: pc
  Date: 2024/3/15
  Time: 16:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1>管理员维护</h1>
<%--使用JSTL循环列表，渲染--%>
<table border="1" cellspacing="0" cellpadding="10" width="100%" style="text-align: center">
    <p><a href="/admin/addPage">添加</a></p>
    <tr>
        <th>id</th>
        <th>管理员名称</th>
        <th>管理员密码</th>
        <th colspan="2">操作</th>
    </tr>
    <c:forEach items="${list}" var="admin">
        <tr>
            <td>${admin.id}</td>
            <td>${admin.admin}</td>
            <td>${admin.password}</td>
            <td>
                <a href="edit.jsp?id=${admin.id}&admin=${admin.admin}&password=${admin.password}">编辑</a>
            </td>
            <td>
                <a href="/admin/delete?id=${admin.id}">删除</a>
            </td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
